package com.itheima.字符流;

import java.io.*;
import java.util.Arrays;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bf = new BufferedWriter(new FileWriter("day13_字符流&properties\\a.txt"));
        String s = "-1 13 5 23 42 10";
        bf.write(s);
        bf.flush();

        BufferedReader br = new BufferedReader(new FileReader("day13_字符流&properties\\a.txt"));
        String line = br.readLine();
        System.out.println(line);
        String[] split = line.split(" ");
        int[] arr = new int[split.length];
        for (int i = 0; i < arr.length; i++) {
            int num = Integer.parseInt(split[i]);
            arr[i] = num;
        }
        Arrays.sort(arr);
        bf.newLine();

        for (int i = 0; i < arr.length; i++) {
            bf.write(arr[i]+" ");
        }
        bf.close();
        br.close();
    }
}
